package cn.fengzhilun.javase.day08;

public class Rectangle {
	private double width=1;
	private double height=1;
	
	public Rectangle() {}
	
	public Rectangle(double width,double height) {
		this.width=width;
		this.height=height;
	}
	
	public double getArea() {
		
		return width*height;
	}
	
	public double getPerimeter() {
		return (width+height)*2;
	}

	/**
	 * @return the width
	 */
	public double getWidth() {
		return width;
	}

	/**
	 * @param width the width to set
	 */
	public void setWidth(double width) {
		this.width = width;
	}

	/**
	 * @return the height
	 */
	public double getHeight() {
		return height;
	}

	/**
	 * @param height the height to set
	 */
	public void setHeight(double height) {
		this.height = height;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Rectangle [width=" + width + ", height=" + height + ", getArea()=" + getArea() + ", getPerimeter()="
				+ getPerimeter() + ", getWidth()=" + getWidth() + ", getHeight()=" + getHeight() + ", getClass()="
				+ getClass() + ", hashCode()=" + hashCode() + ", toString()=" + super.toString() + "]";
	}
	
}
